#ifndef VLPROPERTIESWIDGET_H
#define VLPROPERTIESWIDGET_H

#include <QDockWidget>
#include <QTableView>
#include <QVBoxLayout>
#include <QStandardItemModel>
#include <QStringList>
#include "GameStates.h"
#include "GameEngine.h"
#include "vldoubledelegate.h"

struct propertyValuePair {
    QStandardItem *value;
    QStandardItem *property;
};

enum GAMESTATEOPTIONS {
    STEP_SIZE,
    JUMP_HEIGHT,
    GRAVITY,
    RESTITUTION,
    VISCOUS_DRAG,
    FRICTION,
    HP_CHANGE_DELAY
};

class VLPropertiesWidget : public QWidget
{
    Q_OBJECT

    int numProps;

    QTableView *tableView;
    QVBoxLayout *vertLayout;
    QHBoxLayout *posLayout;
    QPushButton *resetButton;
    QSpinBox* spX, *spY, *spZ;
    QLabel *posLabel;

    QStandardItemModel *gameStateModel;
    GameStates *gameState;
    QStringList *headers;

    propertyValuePair stepSizePr;
    propertyValuePair jumpHeightPr;
    propertyValuePair gravityPr;
    propertyValuePair restitutionPr;
    propertyValuePair viscousDragPr;
    propertyValuePair frictionPr;
    propertyValuePair hpChangeDelayPr;

    QList<propertyValuePair> *pairList;

    QStandardItemModel *model;
    VLDoubleDelegate *doubleDelegate;

public:
    explicit VLPropertiesWidget(QWidget *parent = 0);
    QSize sizeHint() const;
    
signals:
    
public slots:
    void setModelData(QModelIndex, QModelIndex);
    void resetGame();
    void setStartPosition(int n);
};

#endif // VLPROPERTIESWIDGET_H
